<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <!-- import CSS -->
  <link rel="stylesheet" href="css/element-ui.css">
</head>
<body>
<div id="app">
  <el-button @click="getClue">线索</el-button>
  <el-button @click="getBussiness">商机</el-button>
  <el-descriptions title="线索信息">
    <el-descriptions-item label="用户名">{{clue.name}}</el-descriptions-item>
    <el-descriptions-item label="手机号">{{clue.phone}}</el-descriptions-item>
    <el-descriptions-item label="居住地">苏州市</el-descriptions-item>
    <el-descriptions-item label="备注">
      <el-tag size="small">学校</el-tag>
    </el-descriptions-item>
    <el-descriptions-item label="联系地址">江苏省苏州市吴中区吴中大道 1188 号</el-descriptions-item>
  </el-descriptions>
  <el-descriptions title="商机信息">
    <el-descriptions-item label="用户名">{{business.name}}</el-descriptions-item>
    <el-descriptions-item label="手机号">{{business.phone}}</el-descriptions-item>
    <el-descriptions-item label="居住地">苏州市</el-descriptions-item>
    <el-escriptions-item label="备注">
      <el-tag size="small">学校</el-tag>
    </el-escriptions-item>
    <el-descriptions-item label="联系地址">江苏省苏州市吴中区吴中大道 1188 号</el-descriptions-item>
  </el-descriptions>
</div>
</body>
<script src="js/vue.global.js"></script>
<script src="js/element-ui.js"></script>
<script src="js/axios.min.js"></script>
<script>
  new Vue({
    el: '#app',
    data: function() {
      return {
        visible: false,
        clue: {},
        business: {},
      }
    },
    methods: {
      getClue() {
        axios
            .get('http://localhost:7001/clue-service/clues/1')
            .then(response => {
              this.clue = response.data.data;
            })
            .catch(function (error) { // 请求失败处理
              console.log(error);
            });
      },
      getBussiness() {
        axios
                .get('http://localhost:7001/business-service/business/1')
                .then(response => {
                  this.business = response.data.data;
                })
                .catch(function (error) { // 请求失败处理
                  console.log(error);
                });
      }
    }
  })
</script>
</html>
